using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using ExamServer.Entities;
using Microsoft.EntityFrameworkCore;

namespace ExamServer.Service
{
  public class RolesRepository : RepositoryBase<tbRoles,int>, IRolesRepository
  {
      public RolesRepository(DbContext dbContext):base(dbContext)
      {
          
      }

    public async Task<tbRoles> GetRolesById(int id)
    {
      //var entity =await GetByIdAsync(id);
      var roles =await dbContext.Set<tbRoles>().Include(r=>r.RolesAndMenus).FirstOrDefaultAsync(x=>x.ID==id);
      return roles;
    }
  }
}